package com.baitiaojun.api.domain.user;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Pattern;
import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ApiModel("用户拥有的硬币")
public class UserCoin {

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(readOnly = true)
    private Long id;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(readOnly = true)
    private Long userid;

    @Pattern(regexp = "^[12]$", message = "只能投1个或者2个币")
    @ApiModelProperty(value = "硬币总数", required = true)
    private Long amount;

    @ApiModelProperty(readOnly = true)
    private Date createtime;

    @ApiModelProperty(readOnly = true)
    private Date updatetime;
}